<template>
	<view class="article column">
		<view class="column radius20 hidden scrolly flex-1" v-if="!isLoading">
			<view class="cell_item" v-for="item in articleList" :key="item.code"
				@click="navTo('pages/article/details',{code:item.code})">
				<text>{{item.title}}</text>
				<u-icon name="arrow-right" />
			</view>
		</view>
		<view class="column" v-if="isLoading">
			<view class="cell_item" v-for="item in 15" :key="item">
				<u-skeleton :loading="true" :title="false" rows="1" rowsWidth="100%" />
			</view>
			<zero-loading mask color="#41a544" />
		</view>
	</view>
</template>

<script setup>
	import {
		ref
	} from 'vue';
	/* 	import {
			getList
		} from '@/api/article' */
	import {
		onLoad,
	} from "@dcloudio/uni-app";
	import {
		navTo
	} from '@/core/app';
	const articleList = ref([])
	const isLoading = ref(false)
	onLoad(async () => {
		/* isLoading.value = true
		let res = await getList()
		if (res) {
			articleList.value = res.data
			isLoading.value = false
		} */
	})
</script>

<style lang="scss" scoped>
	.article {
		width: calc(100% - 60rpx);
		height: calc(100% - 60rpx);
		padding: 30rpx;

		.cell_item {
			background: #fff;
			padding: 25rpx 37rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;
			border-bottom: 1rpx solid #efefef;

			&:active {
				background: rgba(0, 0, 0, .1);
			}
		}
	}
</style>